package org.volicy.scheduled.resp;

import java.io.Serializable;

/**
 * @Author: volicy.xu
 * @Date: 2021/9/22
 */
public class ScheduledResp implements Serializable {
    private static final long serialVersionUID = -2617151955120996056L;

    private Object data;

    private String message;

    private String code;


    public ScheduledResp(Object data, String message, String code) {
        this.data = data;
        this.message = message;
        this.code = code;
    }
    /**
     *
     * @param data
     * @return
     */
    public static ScheduledResp successInstance(Object data){
        return new ScheduledResp(data == null?"":data,"","0");
    }

    /**
     *
     * @return
     */
    public static ScheduledResp successInstance(){
        return new ScheduledResp("","","0");
    }
    public static ScheduledResp failInstance(){
        return new ScheduledResp("","","1");
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
